package com.chaoyue.media.service;



import com.chaoyue.base.model.PageParams;
import com.chaoyue.base.model.PageResult;
import com.chaoyue.base.model.RestResponse;
import com.chaoyue.media.beans.dto.QueryMediaParamsDto;
import com.chaoyue.media.beans.dto.UploadFileParamsDto;
import com.chaoyue.media.beans.dto.UploadFileResultDto;
import com.chaoyue.media.beans.po.MediaFiles;

import java.io.File;

@SuppressWarnings({"all"})
/**
 * @description: 媒资文件管理业务类
 * @author whr
 * @date 2023/5/14 20:11
 * @version 1.0
 */
public interface MediaFileService {
    MediaFiles getFileById(String mediaId);

    /**
     * @param pageParams          分页参数
     * @param queryMediaParamsDto 查询条件
     * @return com.xuecheng.base.model.PageResult<com.xuecheng.media.model.po.MediaFiles>
     * @description 媒资文件查询方法
     * @author whr
     * @date 2022/9/10 8:57
     */
    PageResult<MediaFiles> queryMediaFiels(Long companyId, PageParams pageParams, QueryMediaParamsDto queryMediaParamsDto);

    /**
     * @description:
     * @param: companyId 机构id
     * @param: uploadFileParamsDto 上传文件信息
     * @param: localFilePath 文件的本地路径
     * @return: UploadFileResultDto
     * @author whr
     * @date: 2023/5/12 19:59
     */
    UploadFileResultDto uploadFile(UploadFileParamsDto uploadDto);

    RestResponse<Boolean> checkChunk(String fileMd5, int chunkIndex);

    RestResponse<Boolean> checkFile(String fileMd5);

    public RestResponse uploadChunk(String fileMd5, int chunk, String localChunkFilePath);


    MediaFiles addMediaFilesToDb(Long companyId, UploadFileParamsDto uploadFileParamsDto, String fileMd5, String bucket_mediafiles, String objeckName);

    RestResponse<Boolean> mergechunks(Long companyId, String fileMd5, int chunkTotal, UploadFileParamsDto uploadFileParamsDto);




}
